Skip to content

feat: proactive weather ability#233

Merged
Rizwan-095 merged 14 commits intoopenhome-dev:devfrom
melodygui:weather-alerts
Mar 31, 2026
Merged

feat: proactive weather ability#233
Rizwan-095 merged 14 commits intoopenhome-dev:devfrom
melodygui:weather-alerts

Conversation

@melodygui
Copy link
Copy Markdown
Contributor

What does this Ability do?

Provides on-demand weather queries with a concise voice-friendly forecast summary, and runs a background daemon that silently monitors conditions every 10 minutes and proactively interrupts the conversation if severe weather is detected. Also writes local_weather.md to persistent storage so the Personality stays passively aware of local weather conditions throughout the session.

Suggested Trigger Words

  • what's the weather
  • how's the weather
  • weather
  • will it rain
  • do I need an umbrella

Type

  • New community Ability
  • Improvement to existing Ability
  • Bug fix
  • Documentation update

External APIs

  • No external APIs
  • Uses external API(s): Open-Meteo (weather data, free, no API key required), Nominatim/OpenStreetMap (geocoding, free, no API key required)

Testing

  • Tested in OpenHome Live Editor
  • All exit paths tested (said "stop", "exit", etc.)
  • Error scenarios tested (API down, bad input, etc.)

Checklist

  • Files are in community/my-ability-name/
  • main.py follows SDK pattern (extends MatchingCapability, has register_capability + call)
  • README.md included with description, suggested triggers, and setup
  • resume_normal_flow() called on every exit path
  • No print() — using editor_logging_handler
  • No hardcoded API keys — using placeholders
  • No blocked imports (redis, user_config)
  • No asyncio.sleep() or asyncio.create_task() — using session_tasks
  • Error handling on all external calls
  • Tested in OpenHome Live Editor

Anything else?

This ability uses the new background.py daemon infrastructure introduced in the March 2026 SDK update. It is an Interactive Combined ability: main.py handles the reactive weather query flow and background.py runs as a persistent daemon for the entire session.

Implement weather capability to fetch and summarize weather data based on user location.

Signed-off-by: Melody Gui <122416115+melodygui@users.noreply.github.com>
Signed-off-by: Melody Gui <122416115+melodygui@users.noreply.github.com>
Added a README for the Proactive Weather ability, detailing installation and usage instructions.

Signed-off-by: Melody Gui <122416115+melodygui@users.noreply.github.com>
@melodygui melodygui requested a review from a team as a code owner March 30, 2026 00:44
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

🔀 Branch Merge Check

PR direction: weather-alertsdev

Passedweather-alertsdev is a valid merge direction

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

✅ Community PR Path Check — Passed

All changed files are inside the community/ folder. Looks good!

@github-actions github-actions bot added the community-ability Community-contributed ability label Mar 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

✅ Ability Validation Passed

📋 Validating: community/proactive-weather
  ✅ All checks passed!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

🔍 Lint Results

__init__.py — Empty as expected

Files linted: community/proactive-weather/background.py community/proactive-weather/main.py

✅ Flake8 — Passed

✅ All checks passed!

melodygui and others added 10 commits March 29, 2026 18:11
Signed-off-by: Melody Gui <122416115+melodygui@users.noreply.github.com>
Signed-off-by: Melody Gui <122416115+melodygui@users.noreply.github.com>
Added methods to handle city updates and location parsing for weather checks.

Signed-off-by: Uzair Ullah <uzairullahmail@gmail.com>
Signed-off-by: Uzair Ullah <uzairullahmail@gmail.com>
Refactor weather fetching and geocoding to use asyncio for better performance.

Signed-off-by: Uzair Ullah <uzairullahmail@gmail.com>
Signed-off-by: Uzair Ullah <uzairullahmail@gmail.com>
Copy link
Copy Markdown
Contributor

@uzair401 uzair401 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @melodygui , I’ve applied several fixes and improvements to improve stability, SDK compliance, and voice UX.

In main.py, I added a voice format guard to prevent markdown in spoken output, wrapped blocking HTTP calls in asyncio.to_thread(), and introduced a proper city save confirmation flow along with support for updating the saved city via natural phrases. KV handling was improved with a create-or-update pattern and helper functions for cleaner access, along with a one-time city override so user queries don’t overwrite saved preferences. I also removed duplicate and redundant calls and ensured flow cleanup is handled correctly.

In background.py, I fixed a critical bug with saved value access that was causing crashes, removed unnecessary technical details from alerts, added a voice format guard, and fixed JSON handling to prevent corruption.

Approved for community.

As part of our process, abilities go through a 30-day evaluation period where we monitor performance, identify any issues, and make necessary improvements. Once everything meets our quality standards, we proceed with publishing to the marketplace with full credit to the original author.

We truly appreciate your effort and encourage you to continue developing and submitting more abilities.

@Rizwan-095 Rizwan-095 merged commit 3f72c72 into openhome-dev:dev Mar 31, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-ability Community-contributed ability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants